package com.epin.base.enums.commons;

import com.feilong.core.Validator;

/**
 * <p>是否为X枚举</p>
 * 
 * @author fujiajun
 *
 */
public enum IsXEnum {
	
	TRUE(1, "是"),
	FALSE(0, "否");
	
	private int value;
	private String message;
	
	private IsXEnum(int value, String message){
		this.value = value;
		this.message = message;
	}
	
	
	public int val(){
		return this.value;
	}
	
	
	public String msg(){
		return this.message;
	}
	
	
	public static String toString(Integer value) {
		
		if (Validator.isNullOrEmpty(value)) {
			return "";
		}
		
		for (IsXEnum e : IsXEnum.values()) {
			if (value.equals(e.value)) {
				return e.message;
			}
		}
		
		return "";
	}

}
